package com.ztgf.commodity.api.cms;

import com.ztgf.commodity.models.bo.CommodityAdvisoryPriceSaveBO;
import com.ztgf.commodity.models.service.ICommodityAdvisoryPriceService;
import com.ztgf.common.constant.Result;
import com.ztgf.common.enums.CodeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 询价表控制器
 *
 * @author chenyu.wang
 * @Date 2020-05-27 11:06:36
 */

@RestController
@RequestMapping("/cms/commodityAdvisoryPrice")
@Slf4j
@Api(value = "CommodityAdvisoryPriceController", tags = "询价表接口")
public class CommodityAdvisoryPriceController {

    @DubboReference
    private ICommodityAdvisoryPriceService commodityAdvisoryPriceService;

    @PostMapping(value = "/insert")
    @ApiOperation(value = "添加询价表", notes = "添加询价表")
    public Result insert(CommodityAdvisoryPriceSaveBO saveBO) {
        boolean flag = commodityAdvisoryPriceService.add(saveBO);
        if (flag) {
            return new Result<>();
        } else {
            return new Result<>(CodeEnum.FAIL_100007);
        }
    }

}
